<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>

<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								班级：<input type="text" name="classg" />
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()" shiro:hasPermission="acm:rank:list"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()" shiro:hasPermission="acm:rank:list"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "acm/front";
        $(function() {
            var options = {
                url: prefix + "/listrank",
                modalName: "AC排名",
                striped:true,
				search: false,
				showSearch:false,
				showRefresh:false,
				showColumns:false,
				showToggle:false,
				showExport:false,
				sortOrder:"desc",
				sortName:"solved",
				pageSize: 25,
				pageNumber:1,
                columns: [
      				{
    					field : 'id', 
    					title : '用户名',
    					formatter: function(value, row, index) {
    						if($.table.getPageNum('bootstrap-table')==1){
	    						if(index==0) return value+"<img style='width:20px;margin-left:5px;' src='"+ctx+"assets/img/gold.png' />";
	    						else if(index==1) return value+"<img style='width:20px;margin-left:5px;' src='"+ctx+"assets/img/silver.png' />";
	    						else if(index==2) return value+"<img style='width:20px;margin-left:5px;' src='"+ctx+"assets/img/copper.png' />";
	    						else return value;
    						}else return value;
    					}
    				},
				{
					field : 'solved', 
					title : 'AC题数'
				},
				{
					field : 'submit', 
					title : '提交次数'
				}]
            };
            $.table.init(options);
        });

    </script>
</body>
</html>